package gui;

import universe.CelestialBody;
import universe.Planet;
import universe.Universe;
import universe.utils.Vector3D;

public class UniverseSimulation {

	public final static float tf = 1;
	private final static int MAX_X = 500;
	private final static int MAX_Y = 500;

	private Universe universe;
	private double[][] p = new double[][] { { 0, 0, 0 }, { 100, 100, 0 } };

	private final static double[][] v = new double[][] { { 0, 0, 0 },
			{ 0.0001f, -0.0003f, 0 } };

	private float[] rad = new float[] { 20, 5 };
	private float[] mass = new float[] { 500000, 10, 0 };

	public UniverseSimulation() {
		universe = new Universe();

		UniverseFrame mainFrame = new UniverseFrame(universe, MAX_X, MAX_Y);
		mainFrame.setVisible(true);

		for (int i = 0; i < p.length; i++) {
			Vector3D x = new Vector3D(p[i]);
			Vector3D vel = new Vector3D(v[i]);
			CelestialBody cb = new Planet("Planet " + i, mass[i], rad[i], x,
					vel);
			universe.add(cb);
		}

		while (true) {
			mainFrame.update();
		}
	}

	public static void main(String[] args) {
		new UniverseSimulation();
	}

}
